package org.noranj.server;

import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider;
import org.noranj.ws.Conversation;
import org.noranj.ws.JBService;

public class Startup {

  protected Startup() throws Exception{
    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
    sf.setResourceClasses(JBService.class);
    sf.setResourceProvider(JBService.class, new SingletonResourceProvider(JBService.class));
    sf.setAddress("http://localhost:9000/");
    sf.create();
  }
  
  public static void main(String[] args) throws Exception{
    new Startup();
    System.out.println("Server ready...");
    Thread.sleep(5 * 60 * 1000);
    System.out.println("Server exiting");
    System.exit(0);
  }
}
